<?
layout("/inc/layout.html",{title:sysTitle}){
?>

<link rel="stylesheet" href="static/utf8-jsp/third-party/video-js/video-js.css" type="text/css"></link>
<script type="text/javascript" src="static/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="static/utf8-jsp/ueditor.config.js"></script>
<script type="text/javascript" src="static/utf8-jsp/ueditor.all.js"></script>
<script type="text/javascript" src="static/utf8-jsp/lang/zh-cn/zh-cn.js"></script>
<script type="text/javascript" src="static/utf8-jsp/third-party/video-js/video.js"></script>

<link rel="stylesheet" href="static/uploadify/uploadify.css" type="text/css"></link>
<script type="text/javascript" src="static/uploadify/jquery.uploadify.min.js"></script>

<div id="page-wrapper" >
	<!--BEGIN TITLE & BREADCRUMB PAGE-->
	<div id="title-breadcrumb-option-demo" class="page-title-breadcrumb">
		<div class="page-header pull-left">
			<div class="page-title">知识加工</div>
		</div>
		<ol class="breadcrumb page-breadcrumb pull-left">
			<li><i class="fa fa-home"></i>&nbsp;<a href="main.html">首页</a>&nbsp;&nbsp;<i
				class="fa fa-angle-right"></i>&nbsp;&nbsp;</li>
			<li>知识库管理&nbsp;&nbsp;<i class="fa fa-angle-right"></i>&nbsp;&nbsp;</li>
			<li class="active">知识加工</li>
		</ol>

		<div class="clearfix"></div>
	</div>
	<!--END TITLE & BREADCRUMB PAGE-->
	<!--BEGIN CONTENT-->
	<div class="page-content">

		<div class="row">
			<div class="col-lg-12">
				<div class="note note-danger">
					<h3 class="box-heading">${headline}</h3>
					<input type="hidden" value=${headline} id="headline" name="headline" />
					<p>${describe}</p>
				</div>
			</div>
		</div>

		<!-- 知识分类e -->
		<div class="row">

			<div class="col-lg-12">
			 <form action="knowledge-edit-data-detail-update-method.html" method="post" enctype="multipart/form-data" name="wsxForm" id="wsxForm" class="Huiform wsxForm">
				<ul id="generalTab" class="nav nav-tabs ul-edit responsive">
					<li><a href="#dp-tab" data-toggle="tab">基础信息</a></li>
					<?for( op in objectProperty){?>
						<?if(op.nameEn == 'op_lian_xi_xin_xi'){?>
					 		<li class="active"><a href="#${op.nameEn}" onclick="queryrelevance('${op.relevanceClassesId}','${op.id}')" data-toggle="tab">${op.nameZh}</a></li>
                   		<?}else{?>
                   			<li><a href="#${op.nameEn}" onclick="queryrelevance('${op.relevanceClassesId}','${op.id}')" data-toggle="tab">${op.nameZh}</a></li>
                   		<?}?>
                    <?}?>
					<li style="float:right">
					<input type="button"  class="btn btn-primary" onclick="graph()" value="图形展示 "/>&nbsp;&nbsp;&nbsp;
					<input type="button"  class="btn btn-primary" onclick="publish()" value="发布 "/>&nbsp;&nbsp;&nbsp;
					<input type="button"  class="btn btn-primary" onclick="auditWord(1)" value="审核通过 "/>&nbsp;&nbsp;&nbsp;
					<input type="button"  class="btn btn-primary" onclick="auditWord(0)" value="审核不通过 "/>&nbsp;&nbsp;&nbsp;
					<input type="button"  class="btn btn-primary" onclick="returnList()" value="返回"/>
					</li>
					<!-- <li><a href="#op-tab" data-toggle="tab">对象属性（关联关系）</a></li>
                    <li><a href="#word-tab" data-toggle="tab">医学词典关联（词表关联）</a></li>
                    <li><a href="#lifecycle-tab" data-toggle="tab">时间轴（数据生命周期）</a></li> -->
				</ul>
					<input type="hidden" value="${classesEn}" id="classesEn" name="classesEn" /> 
					<input type="hidden" value="${classesId}" id="classesId" name="classesId" /> 
					<input type="hidden" value="${uploadPath}" id="uploadPath" name="uploadPath" /> 
					<input type="hidden" value="${adjunctPath}" id="adjunctPath" name="adjunctPath" /> 
					<input type="hidden" value="${idString}" 	id="idString" name="idString" />
					<input type="hidden" value="${screenContent}" id="screenContent" name="screenContent" />
					<textarea id="uploadImage" name="uploadImage"></textarea>
					<div id="generalTabContent" class="tab-content responsive">
						<div id="dp-tab" class="tab-pane fade">
							<div class="row">
								<?for( dataPropertiesName in dataProperties){
									if(dataPropertiesName.adminDetailShow == '1'){
										for(entry in data){
											var key = entry.key;
								?>

								<!-- 文本框（分词） -->
								<?if(dataPropertiesName.dataTypeId == 3){
									if(key==dataPropertiesName.nameEn){?>
								<div class="col-lg-6">
									<div class="form-group">
										<label for="inputPhone" class="control-label">${dataPropertiesName.nameZh}
										<?if(dataPropertiesName.formValidationRegulation == '*'){?>
												<span class='require'>*</span>
											<?} ?>
										</label>
										<input id=${dataPropertiesName.nameEn} type="text" placeholder="" value="${entry.value}" class="form-control" name=${dataPropertiesName.nameEn} 
											<?if(dataPropertiesName.formValidationRegulation !=''){?>
												datatype="${dataPropertiesName.formValidationRegulation}"
											<?} else {?>
												ignore="ignore"
											<?}?>
										/>
									</div>
								</div>
									<?}
								}?>

								<!-- 文本框（不分词） -->
								<?if(dataPropertiesName.dataTypeId == 2){
									if(key==dataPropertiesName.nameEn){?>
								<div class="col-lg-6">
									<div class="form-group">
										<label for="inputPhone" class="control-label">${dataPropertiesName.nameZh}
										<?if(dataPropertiesName.formValidationRegulation == '*'){?>
												<span class='require'>*</span>
											<?} ?>
										</label>
										<input id=${dataPropertiesName.nameEn} type="text" onchange="verify(this.value,this.name)" demo="${entry.value}" value="${entry.value}" class="form-control"
											value="${entry.value}" name="${dataPropertiesName.nameEn}" 
											<?if(dataPropertiesName.formValidationRegulation !=''){?>
												datatype="${dataPropertiesName.formValidationRegulation}"
											<?} else {?>
												ignore="ignore"
											<?}?>
											/>
									</div>
								</div>
									<?}
								}?>
								<!-- 金额 -->
								<?if(dataPropertiesName.dataTypeId == 21){
									if(key==dataPropertiesName.nameEn){?>
								<div class="col-lg-6">
									<div class="form-group">
										<label for="inputPhone" class="control-label">${dataPropertiesName.nameZh}
										<?if(dataPropertiesName.formValidationRegulation == '*'){?>
												<span class='require'>*</span>
											<?} ?>
										</label>
										<input id=${dataPropertiesName.nameEn} type="text" onchange="verify(this.value,this.name)" demo="${entry.value}" value="${entry.value}" class="form-control"
											value="${entry.value}" name="${dataPropertiesName.nameEn}" 
											<?if(dataPropertiesName.formValidationRegulation !=''){?>
												datatype="${dataPropertiesName.formValidationRegulation}"
											<?} else {?>
												ignore="ignore"
											<?}?>
											/>
									</div>
								</div>
									<?}
								}?>
								<!-- 密码 -->
								<?if(dataPropertiesName.dataTypeId == 14){
									if(key==dataPropertiesName.nameEn){?>
								<div class="col-lg-6">
									<div class="form-group">
										<label for="inputPhone" class="control-label">${dataPropertiesName.nameZh}
										<?if(dataPropertiesName.formValidationRegulation == '*'){?>
												<span class='require'>*</span>
											<?} ?>
										</label>
										<input id=${dataPropertiesName.nameEn} type="password" placeholder="" value="${entry.value}" class="form-control"
											value="${entry.value}" name="${dataPropertiesName.nameEn}" 
											<?if(dataPropertiesName.formValidationRegulation !=''){?>
												datatype="${dataPropertiesName.formValidationRegulation}"
											<?} else {?>
												ignore="ignore"
											<?}?>
											/>
									</div>
								</div>
									<?}
								}?>
							
								<!-- 文本域 -->
								<?if(dataPropertiesName.dataTypeId ==4){
									if(key==dataPropertiesName.nameEn){?>
								<div class="col-lg-12">
									<div class="form-group">
										<label for="inputPhone" class="control-label">${dataPropertiesName.nameZh}
										<?if(dataPropertiesName.formValidationRegulation == '*'){?>
												<span class='require'>*</span>
											<?} ?>
										</label>
										<textarea id=${dataPropertiesName.nameEn} rows="4" class="form-control" name=${dataPropertiesName.nameEn} 
											<?if(dataPropertiesName.formValidationRegulation !=''){?>
												datatype="${dataPropertiesName.formValidationRegulation}"
											<?} else {?>
												ignore="ignore"
											<?}?>
										>${entry.value}</textarea>
									</div>
								</div>
									<?}
								}?>

								<!-- HTML（大区域） -->
								<?if(dataPropertiesName.dataTypeId ==6){
									if(key==dataPropertiesName.nameEn){?>
									<div class="col-lg-12">
										<div class="form-group">
											<label for="inputPhone" class="control-label">${dataPropertiesName.nameZh}</label>
											<script id="${dataPropertiesName.nameEn}" name="${dataPropertiesName.nameEn}" type="text/plain">${entry.value}</script>
												<script type="text/javascript" >
													var ue = UE.getEditor('${dataPropertiesName.nameEn}',{ initialFrameHeight:300 });
											</script>
										</div>
									</div>
									<?}
								}?>

								<!-- HTML（小区域） -->
								<?if(dataPropertiesName.dataTypeId == 5){
									if(key==dataPropertiesName.nameEn){?>
									<div class="col-lg-6">
										<div class="form-group">
											<label for="inputPhone" class="control-label">${dataPropertiesName.nameZh}：</label>
											<script id="${dataPropertiesName.nameEn}" name="${dataPropertiesName.nameEn}" type="text/plain">${entry.value}</script>
											<script type="text/javascript" >
												var ue = UE.getEditor('${dataPropertiesName.nameEn}',{ initialFrameHeight:200 ,
											toolbars: [
												['undo', 'redo','|', 'bold', 'italic','underline','|','paragraph','fontfamily',
													'fontsize','forecolor','|', 'justifyleft','justifyright','justifycenter','justifyjustify',
													'|','removeformat','formatmatch','|','rowspacingtop','rowspacingbottom','lineheight','insertorderedlist','insertunorderedlist'
												]
											 ]
											});
											</script>
										</div>
									</div>
									<?}
								}?>

								<!-- 下拉菜单（单值） -->
								<?if(dataPropertiesName.dataTypeId == 7){
									if(key==dataPropertiesName.nameEn){ ?>
									
									<div class="col-lg-6">
										<div class="form-group">
											<label for="inputPhone" class="control-label">${dataPropertiesName.nameZh}
											<?if(dataPropertiesName.formValidationRegulation == '*'){ ?>
												<span class='require'>*</span>
											<?} ?>
											</label>
											<div class="form-group">
												<?for( dMap in dictsMap){?>
												<?if(dataPropertiesName.dictId == dMap.key){ ?>
												<?if(dMap.value == 1){ ?>
													<select class="form-control" id="${dataPropertiesName.id}" name="${dataPropertiesName.nameEn}" 
													<?if(dataPropertiesName.formValidationRegulation !=''){?>
														datatype="${dataPropertiesName.formValidationRegulation}"
													<?} else {?>
														ignore="ignore"
													<?}?>
													>
													<option value=''>--请选择--</option>
														<?for(res in resultString){
																if(res.dpid==dataPropertiesName.id){
																	if(res.value == entry.value){?>
															<option value="${res.value}" selected="selected">${res.nameZh}</option>
															<?}else{?>
															<option value="${res.value}">${res.nameZh}</option>
															<?}
															}
															}?>
												</select>
												<? } else { ?>
												<div class="input-group input-group-sm mbs">
												<?for(res in resultString){
																if(res.dpid==dataPropertiesName.id){
																	if(res.value == entry.value){ ?>
													<input id="dictitemName_${dataPropertiesName.id}" type="text" value="${res.nameZh}" placeholder="${res.nameZh}" class="form-control" disabled="true" />
													<input name="${dataPropertiesName.nameEn}" id="dictitemId_${dataPropertiesName.id}" type="hidden" class="form-control" value="${res.value}" 
														<?if(dataPropertiesName.formValidationRegulation !=''){?>
															datatype="${dataPropertiesName.formValidationRegulation}"
														<?} else {?>
															ignore="ignore"
														<?}?>
													/>
													 <?}
													 	}
													 		}?>
													 		<?for (dv in dicValue){ ?>
															 	<?if(dv.dictDpId == dataPropertiesName.nameEn){ ?>
																		<?if(dv.jieguoji == "" || dv.jieguoji == null){ ?>
															 		<input id="dictitemName_${dataPropertiesName.id}" type="text" placeholder="请点击选择"" class="form-control" disabled="true" />
																	<input name="${dataPropertiesName.nameEn}" id="dictitemId_${dataPropertiesName.id}" type="hidden" class="form-control" value="" 
																<?if(dataPropertiesName.formValidationRegulation !=''){ ?>
																	datatype="${dataPropertiesName.formValidationRegulation}"
																<?} else { ?>
																	ignore="ignore"
																<?}?>
															/>
															 <?}
															 		}
															 			}?>
													 <span class="input-group-btn">
											 			<button id="t_${dataPropertiesName.id}" onclick="saveEditZTree('${dataPropertiesName.dictId}','${dataPropertiesName.id}')" type="button" data-toggle="dropdown"
															class="btn btn-success dropdown-toggle">选择类..</button>
													</span>
												</div> 
												
												<? }}} ?>
												
											</div>
										</div>
									</div>
									<? }
								
								}?>

								<!-- 下拉菜单（多值） -->
								<?if(dataPropertiesName.dataTypeId == 20){
									if(key==dataPropertiesName.nameEn){?>
									<div class="col-lg-6">
										<div class="form-group">
											<label for="inputPhone" class="control-label">${dataPropertiesName.nameZh}
											<?if(dataPropertiesName.formValidationRegulation == '*'){?>
												<span class='require'>*</span>
											<?} ?>
											</label>
											<?if(entry.value != ''){?>
											<div class="input-group input-group-sm mbs">
													<?for(multi in multiList){
														var multikey = multi.key;
														if(multikey == dataPropertiesName.nameEn){
													?>
														<input id="dictitemName_${dataPropertiesName.id}" type="text" value="${multi.value}" placeholder="${multi.value}" class="form-control" disabled="true" />
													<?}}?>
													 <span class="input-group-btn">
													 	<button id="t_${dataPropertiesName.id}" onclick="multiEditZTree('${dataPropertiesName.dictId}','${dataPropertiesName.id}')" type="button" data-toggle="dropdown" class="btn btn-success dropdown-toggle">选择类..</button>
													</span>
														<input name="${dataPropertiesName.nameEn}" id="dictitemId_${dataPropertiesName.id}" type="hidden" class="form-control" value="${entry.value}" 
												<?if(dataPropertiesName.formValidationRegulation !=''){?>
													datatype="${dataPropertiesName.formValidationRegulation}"
												<?} else {?>
													ignore="ignore"
												<?}?>
												/>
											</div>
											<?}else{?>
												<div class="input-group input-group-sm mbs">
														<input id="dictitemName_${dataPropertiesName.id}" type="text" placeholder="请点击选择" class="form-control" disabled="true" />
														 <span class="input-group-btn">
														 	<button id="t_${dataPropertiesName.id}" onclick="multiEditZTree('${dataPropertiesName.dictId}','${dataPropertiesName.id}')" type="button" data-toggle="dropdown"
																class="btn btn-success dropdown-toggle">选择类..</button>
														</span>
														<input name="${dataPropertiesName.nameEn}" id="dictitemId_${dataPropertiesName.id}" type="hidden" class="form-control" 
														
														 <?if(dataPropertiesName.formValidationRegulation !=''){?>
														datatype="${dataPropertiesName.formValidationRegulation}"
													<?} else {?>
														ignore="ignore"
													<?}?>
													/>
												</div>
											<?}?>
										</div>
									</div>
									<?}
								}?>

								<!-- 上传图片（单个） -->
								<?if(dataPropertiesName.dataTypeId == 8){
									if(key==dataPropertiesName.nameEn){?>
									<div class="col-lg-6">
										<div class="form-group">
											<label for="inputPhone" class="control-label">${dataPropertiesName.nameZh}
											<?if(dataPropertiesName.formValidationRegulation == '*'){?>
												<span class='require'>*</span>
											<?} ?>
											</label><br/>
												<div style= "display:inline " id="single_${dataPropertiesName.id}">
													<?if(entry.value != ''){?>
														<img src="${uploadPath}${entry.value}" onclick="querypho()" width="30" height="30"/>
													<?}?>
												</div>
												<div id="phs" style="display: none;text-align:center;margin:0 auto;">
													<?if(entry.value != ''){?>
														<img src="${uploadPath}${entry.value}"  style="height: auto;max-height: 500px;"/>
													<?}?>
												</div>
										 			<input type="button" class="btn btn-primary" style="width:70px; height: 30px; padding: 0; background-color: #4cae4c; border-color: #4cae4c;" onclick="upImages('${dataPropertiesName.id}')" value="编辑图片" title="只可上传单个图片，如有多个以最后一个为准" />
										 			<input type="button" onclick="deleteImages('${dataPropertiesName.id}')" style="width:70px; height: 30px; padding: 0; "  class="btn btn-default dropdown-toggle" value="删除图片"  />
   													<input type="hidden" id="singlePhone_${dataPropertiesName.id}"  /> 
   													<input type="hidden" value="${entry.value}" name=${dataPropertiesName.nameEn} id="onePhone_${dataPropertiesName.id}" 
   														<?if(dataPropertiesName.formValidationRegulation !=''){?>
															datatype="${dataPropertiesName.formValidationRegulation}"
														<?} else {?>
															ignore="ignore"
														<?}?>
   													 /> 
										</div>
									</div>
									<?}
								}?>

								<!-- 上传图片（多个） -->
								<?if(dataPropertiesName.dataTypeId == 15){
									if(key==dataPropertiesName.nameEn){?>
								<div class="col-lg-6">
									<div class="form-group">
										<label for="inputPhone" class="control-label">${dataPropertiesName.nameZh}
										<?if(dataPropertiesName.formValidationRegulation == '*'){?>
										<span class='require'>*</span>
										<?} ?>
										</label><br/>
											<div style= "display:inline " id="show_${dataPropertiesName.id}"></div>
                 							<input type="button" onclick="upload('${dataPropertiesName.id}',5)" value="新增图片"  />
   											<input type="hidden" id="parentclassname_${dataPropertiesName.id}"  /> 
   											<input type="hidden" name=${dataPropertiesName.nameEn} id="muchPhone_${dataPropertiesName.id}"  /> 
										 	<input type="text" name="muchPhoneText_${dataPropertiesName.id}" value="${entry.value}" />
									</div>
								</div>
								<?}
												}?>

								<!-- 上传附件（单个） -->
								<?if(dataPropertiesName.dataTypeId == 16){
									if(key==dataPropertiesName.nameEn){?>
								<div class="col-lg-6">
									<div class="form-group">
										<label for="inputPhone" class="control-label">${dataPropertiesName.nameZh}
										<?if(dataPropertiesName.formValidationRegulation == '*'){?>
												<span class='require'>*</span>
											<?} ?>
										</label><br/>
											<div style= "display:inline " id="singleName_${dataPropertiesName.id}">
												${entry.value}
											</div>
											<input type="button" class="btn btn-primary" style="width:70px; height: 30px; padding: 0; background-color: #4cae4c; border-color: #4cae4c;" onclick="upFiles('${dataPropertiesName.id}','1')" value="上传文件" title="只可上传单个文件，如有多个以最后一个为准" />
   											<input type="button" onclick="deletefileone('${dataPropertiesName.id}')" style="width:70px; height: 30px; padding: 0;" class="btn btn-default dropdown-toggle" value="删除文件"  />
   											<?for (pp in picturePath){
   												if(pp.key == dataPropertiesName.nameEn){
   											?>
   												<input type="hidden" name=${dataPropertiesName.nameEn} id="singFile_${dataPropertiesName.id}" value="${pp.value}" />
											<?}}?>
									</div>
								</div>
								<?}
									}?>

								<!-- 上传附件（多个） -->
								<?if(dataPropertiesName.dataTypeId == 17){
									if(key==dataPropertiesName.nameEn){?>
								<div class="col-lg-6">
									<div class="form-group">
										<label for="inputPhone" class="control-label">${dataPropertiesName.nameZh}
										<?if(dataPropertiesName.formValidationRegulation == '*'){?>
												<span class='require'>*</span>
											<?} ?>
										</label><br/>
										<div style= "display:inline " id="adjunctname_${dataPropertiesName.id}">
											${entry.value}
										</div>
										<input type="button" class="btn btn-primary" onclick="upFiles('${dataPropertiesName.id}','2')" value="上传文件"  />
										<input type="button" onclick="deletefilemuch('${dataPropertiesName.id}')"  class="btn btn-default dropdown-toggle" value="删除文件"  />
										<!-- <input type="file" id="muchFile_${dataPropertiesName.id}" name="muchFile_${dataPropertiesName.id}"/>
   										<div id="filemuchQueue_${dataPropertiesName.id}"></div>  -->
   										<?for (pp in picturePath){
   												if(pp.key == dataPropertiesName.nameEn){
   											?>
   												<input type="hidden" name=${dataPropertiesName.nameEn} id="singleAdjunctmuch_${dataPropertiesName.id}" value="${pp.value}" />
											<?}}?>
									</div>
								</div>
								<?}
									}?>
								<!-- 阿里云上传 -->
								<?if(dataPropertiesName.dataTypeId == 22){
									if(key==dataPropertiesName.nameEn){?>
									<div class="col-lg-6">
										<div class="form-group">
											<label for="inputPhone" class="control-label">${dataPropertiesName.nameZh}
											<?if(dataPropertiesName.formValidationRegulation == '*'){?>
												<span class='require'>*</span>
											<?} ?>
											</label>
											
											<div class="input-group input-group-sm mbs">
													<input id="dictitemName_${dataPropertiesName.id}" type="text" value='${entry.value}' class="form-control" disabled="true" />
													 <span class="input-group-btn">
													 	<button id="t_${dataPropertiesName.id}" onclick="aliyunUploading('${dataPropertiesName.id}')" type="button" data-toggle="dropdown" class="btn btn-success dropdown-toggle">选择文..</button>
													</span>
														<input name="${dataPropertiesName.nameEn}" id="dictitemId_${dataPropertiesName.id}" type="hidden" class="form-control" value='${entry.value}' 
												<?if(dataPropertiesName.formValidationRegulation !=''){?>
													datatype="${dataPropertiesName.formValidationRegulation}"
												<?} else {?>
													ignore="ignore"
												<?}?>
												/>
											</div>
										</div>
									</div>
									<?}
								}?>
								<!-- 数值 -->
								<?if(dataPropertiesName.dataTypeId == 9){
														if(key==dataPropertiesName.nameEn){
											?>
								<div class="col-lg-6">
									<div class="form-group">
										<label for="inputPhone" class="control-label">${dataPropertiesName.nameZh}
										<?if(dataPropertiesName.formValidationRegulation == '*'){?>
												<span class='require'>*</span>
											<?} ?>
										</label>
										<input id=${dataPropertiesName.nameEn} type="text" placeholder="" class="form-control" value="${entry.value}"
											name=${dataPropertiesName.nameEn} 
											<?if(dataPropertiesName.formValidationRegulation !=''){?>
												datatype="${dataPropertiesName.formValidationRegulation}"
											<?} else {?>
												ignore="ignore"
											<?}?>
											/>
									</div>
								</div>
								<?}
												}?>

								<!-- 日期（年） -->
								<?if(dataPropertiesName.dataTypeId == 10){
														if(key==dataPropertiesName.nameEn){
											?>
								<div class="col-lg-6">
									<div class="form-group">
										<label for="inputPhone" class="control-label">${dataPropertiesName.nameZh}
										<?if(dataPropertiesName.formValidationRegulation == '*'){?>
												<span class='require'>*</span>
											<?} ?>
										</label>
										<input id=${dataPropertiesName.nameEn} type="text"
											onclick="WdatePicker({skin:'whyGreen',dateFmt:'yyyy'})"
											class="form-control" value="${entry.value}"
											name=${dataPropertiesName.nameEn} 
											<?if(dataPropertiesName.formValidationRegulation !=''){?>
												datatype="${dataPropertiesName.formValidationRegulation}"
											<?} else {?>
												ignore="ignore"
											<?}?>
											/>
									</div>
								</div>
								<?}
												}?>

								<!-- 日期（年-月） -->
								<?if(dataPropertiesName.dataTypeId == 11){
														if(key==dataPropertiesName.nameEn){
											?>
								<div class="col-lg-6">
									<div class="form-group">
										<label for="inputPhone" class="control-label">${dataPropertiesName.nameZh}
										<?if(dataPropertiesName.formValidationRegulation == '*'){?>
												<span class='require'>*</span>
											<?} ?>
										</label>
										<input id=${dataPropertiesName.nameEn} type="text"
											onclick="WdatePicker({skin:'whyGreen',dateFmt:'yyyy-MM'})"
											class="form-control" value="${entry.value}"
											name=${dataPropertiesName.nameEn}
											<?if(dataPropertiesName.formValidationRegulation !=''){?>
												datatype="${dataPropertiesName.formValidationRegulation}"
											<?} else {?>
												ignore="ignore"
											<?}?>
											 />
									</div>
								</div>
								<?}
												}?>

								<!-- 日期（年-月-日） -->
								<?if(dataPropertiesName.dataTypeId == 12){
														if(key==dataPropertiesName.nameEn){
											?>
								<div class="col-lg-6">
									<div class="form-group">
										<label for="inputPhone" class="control-label">${dataPropertiesName.nameZh}
										<?if(dataPropertiesName.formValidationRegulation == '*'){?>
												<span class='require'>*</span>
											<?} ?>
										</label>
										<input id=${dataPropertiesName.nameEn} type="text"
											onclick="WdatePicker({skin:'whyGreen',dateFmt:'yyyy-MM-dd'})"
											class="form-control" value="${entry.value}"
											name=${dataPropertiesName.nameEn} 
											<?if(dataPropertiesName.formValidationRegulation !=''){?>
												datatype="${dataPropertiesName.formValidationRegulation}"
											<?} else {?>
												ignore="ignore"
											<?}?>
											/>
									</div>
								</div>
								<?}
												}?>

								<!-- 日期（年-月-日 时-分-秒） -->
								<?if(dataPropertiesName.dataTypeId ==13){
														if(key==dataPropertiesName.nameEn){
											?>
								<div class="col-lg-6">
									<div class="form-group">
										<label for="inputPhone" class="control-label">${dataPropertiesName.nameZh}
										<?if(dataPropertiesName.formValidationRegulation == '*'){?>
												<span class='require'>*</span>
											<?} ?>
										</label>
										<input id=${dataPropertiesName.nameEn} type="text" value="${entry.value}"
											onclick="WdatePicker({skin:'whyGreen',dateFmt:'yyyy-MM-dd HH:mm:ss'})"
											class="form-control"
											name=${dataPropertiesName.nameEn} 
											<?if(dataPropertiesName.formValidationRegulation !=''){?>
												datatype="${dataPropertiesName.formValidationRegulation}"
											<?} else {?>
												ignore="ignore"
											<?}?>
											/>
									</div>
								</div>
								<?}
												}?>
								<?}?>

								<?}?>
								<?}?>
								<!-- 
                            <div class="col-lg-6">
                            	<div class="form-group">
                                    <label for="inputPhone" class="control-label">中文名称：</label>
                                    <input id="inputPhone" type="text" placeholder="" class="form-control" />
                                </div>
                            </div>
                            <div class="col-lg-6">
                            	<div class="form-group">
                                    <label for="inputPhone" class="control-label">英文名称：</label>
                                    <input id="inputPhone" type="text" placeholder="" class="form-control" />
                                </div>
                            </div>
                            <div class="col-lg-6">
                            	<div class="form-group">
                                    <label for="inputPhone" class="control-label">别名：</label>
                                    <input id="inputPhone" type="text" placeholder="" class="form-control" />
                                </div>
                            </div>
                            <div class="col-lg-6">
                            	<div class="form-group">
                                    <label for="inputPhone" class="control-label">缩写：</label>
                                    <input id="inputPhone" type="text" placeholder="" class="form-control" />
                                </div>
                            </div>
                            <div class="col-md-12">
                            	<div class="form-group">
                                    <label for="inputPhone" class="control-label">概览：</label>
                                    <textarea id="inputContent" rows="3" class="form-control"></textarea>
                                </div>
                            </div>
                            <div class="col-lg-6">
                            	<div class="form-group">
                                    <label for="inputPhone" class="control-label">高发性别：</label>
                                    <input id="inputPhone" type="text" placeholder="" class="form-control" />
                                </div>
                            </div>
                            <div class="col-lg-6">
                            	<div class="form-group">
                                    <label for="inputPhone" class="control-label">高发年龄：</label>
                                    <input id="inputPhone" type="text" placeholder="" class="form-control" />
                                </div>
                            </div>
                            <div class="col-lg-6">
                            	<div class="form-group">
                                    <label for="inputPhone" class="control-label">好发人群：</label>
                                    <input id="inputPhone" type="text" placeholder="" class="form-control" />
                                </div>
                            </div>
                            <div class="col-lg-6">
                            	<div class="form-group">
                                    <label for="inputPhone" class="control-label">发病部位：</label>
                                    <input id="inputPhone" type="text" placeholder="" class="form-control" />
                                </div>
                            </div>
                        </div>
                    </div>
                    <div id="op-tab" class="tab-pane fade">
                        <div class="row">
                            
                            <div class="col-lg-6">
                            	<div class="portlet box portlet-blue">
	                                <div class="portlet-header">
	                                    <div class="caption">概述</div>
	                                </div>
	                                <div style="overflow: hidden;" class="portlet-body">
	                                    <div class="portlet-scroll">
	                                        <div class="row">
						                		<div class="col-lg-6">
					                            	<div class="form-group">
					                                    <label for="inputPhone" class="control-label">来源：</label>
					                                    <input id="inputPhone" type="text" placeholder="" class="form-control" />
					                                </div>
					                            </div>
					                            <div class="col-lg-6">
					                            	<div class="form-group">
					                                    <label for="inputPhone" class="control-label">版次：</label>
					                                    <input id="inputPhone" type="text" placeholder="" class="form-control" />
					                                </div>
					                            </div>
					                            <div class="col-lg-6">
					                            	<div class="form-group">
					                                    <label for="inputPhone" class="control-label">作者：</label>
					                                    <input id="inputPhone" type="text" placeholder="" class="form-control" />
					                                </div>
					                            </div>
					                            <div class="col-lg-6">
					                            	<div class="form-group">
					                                    <label for="inputPhone" class="control-label">更新日期：</label>
					                                    <input id="inputPhone" type="text" placeholder="" class="form-control" />
					                                </div>
					                            </div>
					                            <div class="col-md-12">
					                            	<div class="form-group">
					                                    <label for="inputPhone" class="control-label">描述：</label>
					                                    <textarea id="inputContent" rows="4" class="form-control"></textarea>
					                                </div>
					                            </div>
						                	</div>
						                	
	                                    </div>
	                                </div>
	                            </div>
                            </div>
                            
                            <div class="col-lg-6">
                            	<div class="portlet box portlet-blue">
	                                <div class="portlet-header">
	                                    <div class="caption">流行病学</div>
	                                </div>
	                                <div style="overflow: hidden;" class="portlet-body">
	                                    <div class="portlet-scroll">
	                                        <div class="row">
						                		<div class="col-lg-6">
					                            	<div class="form-group">
					                                    <label for="inputPhone" class="control-label">来源：</label>
					                                    <input id="inputPhone" type="text" placeholder="" class="form-control" />
					                                </div>
					                            </div>
					                            <div class="col-lg-6">
					                            	<div class="form-group">
					                                    <label for="inputPhone" class="control-label">版次：</label>
					                                    <input id="inputPhone" type="text" placeholder="" class="form-control" />
					                                </div>
					                            </div>
					                            <div class="col-lg-6">
					                            	<div class="form-group">
					                                    <label for="inputPhone" class="control-label">作者：</label>
					                                    <input id="inputPhone" type="text" placeholder="" class="form-control" />
					                                </div>
					                            </div>
					                            <div class="col-lg-6">
					                            	<div class="form-group">
					                                    <label for="inputPhone" class="control-label">更新日期：</label>
					                                    <input id="inputPhone" type="text" placeholder="" class="form-control" />
					                                </div>
					                            </div>
					                            <div class="col-md-12">
					                            	<div class="form-group">
					                                    <label for="inputPhone" class="control-label">描述：</label>
					                                    <textarea id="inputContent" rows="4" class="form-control"></textarea>
					                                </div>
					                            </div>
						                	</div>
						                	
	                                    </div> 
	                                </div>
	                            </div>
                            </div>
                            
                            <div class="col-lg-6">
                            	<div class="portlet box portlet-blue">
	                                <div class="portlet-header">
	                                    <div class="caption">病原学</div>
	                                </div>
	                                <div style="overflow: hidden;" class="portlet-body">
	                                    <div class="portlet-scroll">
	                                        <div class="row">
						                		<div class="col-lg-6">
					                            	<div class="form-group">
					                                    <label for="inputPhone" class="control-label">来源：</label>
					                                    <input id="inputPhone" type="text" placeholder="" class="form-control" />
					                                </div>
					                            </div>
					                            <div class="col-lg-6">
					                            	<div class="form-group">
					                                    <label for="inputPhone" class="control-label">版次：</label>
					                                    <input id="inputPhone" type="text" placeholder="" class="form-control" />
					                                </div>
					                            </div>
					                            <div class="col-lg-6">
					                            	<div class="form-group">
					                                    <label for="inputPhone" class="control-label">作者：</label>
					                                    <input id="inputPhone" type="text" placeholder="" class="form-control" />
					                                </div>
					                            </div>
					                            <div class="col-lg-6">
					                            	<div class="form-group">
					                                    <label for="inputPhone" class="control-label">更新日期：</label>
					                                    <input id="inputPhone" type="text" placeholder="" class="form-control" />
					                                </div>
					                            </div>
					                            <div class="col-md-12">
					                            	<div class="form-group">
					                                    <label for="inputPhone" class="control-label">描述：</label>
					                                    <textarea id="inputContent" rows="4" class="form-control"></textarea>
					                                </div>
					                            </div>
						                	</div>
						                	
	                                    </div>
	                                </div>
	                            </div>
                            </div>
                            
                            <div class="col-lg-6">
                            	<div class="portlet box portlet-blue">
	                                <div class="portlet-header">
	                                    <div class="caption">病因</div>
	                                </div>
	                                <div style="overflow: hidden;" class="portlet-body">
	                                    <div class="portlet-scroll">
	                                        <div class="row">
						                		<div class="col-lg-6">
					                            	<div class="form-group">
					                                    <label for="inputPhone" class="control-label">来源：</label>
					                                    <input id="inputPhone" type="text" placeholder="" class="form-control" />
					                                </div>
					                            </div>
					                            <div class="col-lg-6">
					                            	<div class="form-group">
					                                    <label for="inputPhone" class="control-label">版次：</label>
					                                    <input id="inputPhone" type="text" placeholder="" class="form-control" />
					                                </div>
					                            </div>
					                            <div class="col-lg-6">
					                            	<div class="form-group">
					                                    <label for="inputPhone" class="control-label">作者：</label>
					                                    <input id="inputPhone" type="text" placeholder="" class="form-control" />
					                                </div>
					                            </div>
					                            <div class="col-lg-6">
					                            	<div class="form-group">
					                                    <label for="inputPhone" class="control-label">更新日期：</label>
					                                    <input id="inputPhone" type="text" placeholder="" class="form-control" />
					                                </div>
					                            </div>
					                            <div class="col-md-12">
					                            	<div class="form-group">
					                                    <label for="inputPhone" class="control-label">描述：</label>
					                                    <textarea id="inputContent" rows="4" class="form-control"></textarea>
					                                </div>
					                            </div>
						                	</div>
						                	
	                                    </div>
	                                </div>
	                            </div>
                            </div>
                            
                            
                        </div>
                    </div>
                    <div id="word-tab" class="tab-pane fade">
                        <div class="row">
                           <div class="col-lg-6">
                               <div class="note note-success">
                                   <h3>二甲胂酸氧化物</h3>
                                   <p>〖中文同义词〗卡代发烟液体</p>
                                   <p>〖英文根词〗alcarsin</p>
                                   <p>〖英文同义词〗Cadet's fuming liquid;cacodyloxide,alkarsin,alcarsin;alkarsin;Cadet fuming liquid</p>
                               </div>
                               <div class="note note-info">
                                   <h3>二甲十八胺</h3>
                                   <p>〖中文同义词〗地孟汀;二甲氨基十八胺;地曼丁;地曼汀;地孟丁</p>
                                   <p>〖中文释义〗［驱肠虫药］ 来源：【现代英汉药物词汇】<br/>抗寄生虫病药物/驱肠虫药</p>
                                   <p>〖英文根词〗Dimantine</p>
                                   <p>〖英文同义词〗Dymanthine</p>
                               </div>
                           </div>
                           <div class="col-lg-6">
                               <div class="note note-warning">
                                   <h3>二甲双胍,甲福明,降糖片</h3>
                                   <p>〖中文释义〗用法:轻症糖尿病：一次0.25～0.5g，一日3次，口服。注意:糖尿病昏迷、急性发热、肝肾功能不全患者慎用。 来源：【英汉常用药物词典】</p>
                                   <p>〖英文根词〗metformin</p>
                               </div>
                               <div class="note note-danger">
                                   <h3>二甲戊胺</h3>
                                   <p>〖英文根词〗methylhexaneamine</p>
                               </div>
                           </div>
                       </div>
                    </div>
                    <div id="lifecycle-tab" class="tab-pane fade">
                        <div class="row">
                            <div class="col-lg-12">
                            	
                            	<div class="timeline-centered timeline-sm">
					                <article class="timeline-entry">
					                    <div class="timeline-entry-inner">
					                        <time datetime="2014-01-10T03:45" class="timeline-time"><span>2016-8-5</span><span>23:07:08</span>
					                        </time>
					                        <div class="timeline-icon bg-violet"><i class="fa fa-exclamation"></i>
					                        </div>
					                        <div class="timeline-label">
					                            <h4 class="timeline-title">admin</h4>
					                            <p>更新了疾病名称信息</p>
					                        </div>
					                    </div>
					                </article>
					                <article class="timeline-entry left-aligned">
					                    <div class="timeline-entry-inner">
					                        <time datetime="2014-01-10T03:45" class="timeline-time"><span>2016-8-5</span><span> 13:07:55</span>
					                        </time>
					                        <div class="timeline-icon bg-green"><i class="fa fa-group"></i>
					                        </div>
					                        <div class="timeline-label bg-green">
					                            <h4 class="timeline-title">机智的小安</h4>
					                            <p>上传了疾病图片信息</p>
					                        </div>
					                    </div>
					                </article>
					                <article class="timeline-entry">
					                    <div class="timeline-entry-inner">
					                        <time datetime="2014-01-09T13:22" class="timeline-time"><span>2016-8-5</span><span>03:09:07</span>
					                        </time>
					                        <div class="timeline-icon bg-orange"><i class="fa fa-paper-plane"></i>
					                        </div>
					                        <div class="timeline-label bg-orange">
					                            <h4 class="timeline-title">admin</h4>
					                            <p>通过定时任务导入了数据</p>
					                        </div>
					                    </div>
					                </article>
					            </div>
                            	
                            </div>-->
							</div>
							<input type="submit" value="更新" class="btn btn-primary" />
						</div>
						<div>
						</div>
						<?for( opy in objectProperty){?>
						<?if(opy.nameEn == 'op_lian_xi_xin_xi' ){?>
							<div id="${opy.nameEn}" class="tab-pane fade in active" style="height:666px;">
							<input type="hidden" id="resid" value="${opy.id}"/>
                        	<div class="row mbl">
                        		<!-- <div class="col-lg-6">
						               <div class="input-group input-group-sm mbs">
						              	<span class="input-group-btn">
						               	<select id="filtrate_${opy.id}" class="btn btn-danger dropdown-toggle" style="width :100px;">
						               	</select>
						                  </span><input id="electText_${opy.id}" type="text" placeholder="请输入关键词..." class="form-control" /><span class="input-group-btn"><button type="button" data-toggle="dropdown" onclick="queryselectText()" class="btn btn-success dropdown-toggle">搜索</button></span>
						              </div> 
					          	 </div>-->
					           <div class="col-lg-12"  style="padding-bottom: 5px; ">
					               <div class="tb-group-actions pull-right">
					               <span>当前共:<label id="pageSize_${opy.id}">0</label>条记录</span>
					               <?for( opc in objectPropertyClasses){
									  if(opc.id == opy.relevanceClassesId){
									?>
					               	&nbsp;&nbsp;&nbsp;&nbsp;<button  class="btn btn-sm btn-primary" type="button" onclick="add('${opc.nameEn}','${opc.id}')"/>新增</button>
					               	<?if(classesEn == 'ke_hu_zi_liao'){?>
					               		<?if(roleName == '超级管理员'){?>
					               			&nbsp;&nbsp;&nbsp;&nbsp;<button  class="btn btn-sm btn-primary" type="button" onclick="deleteAllRelevance()"/>删除全部</button>
					              		<?}?>
					               	<?}else{?>
					               		&nbsp;&nbsp;&nbsp;&nbsp;<button  class="btn btn-sm btn-primary" type="button" onclick="deleteAllRelevance()"/>删除全部</button>
					               	<?}?>
					               	&nbsp;&nbsp;&nbsp;&nbsp;<button id="${opy.id}" name="${opy.id}" class="btn btn-sm btn-primary" type="button" onclick="tadAdd('${opc.nameZh}')"/>选择已有数据</button>
					              <?}}?>
					               </div>
					           </div>
					          	<div id="selectpage_up_${opy.id}" style="text-align: center; margin-top: 20px;"></div>
                         		 <table class="table table-hover table-striped table-bordered table-advanced tablesorter mbn">
           							 <thead>
						                <tr id="pText_${opy.id}"></tr>
						            </thead>
            							<tbody id="text_${opy.id}"></tbody>
       						 	</table>
       						 	 <div id="relevanceData_${opy.id}" style="text-align: center;">
       						 	 	<span class='subtitle' style='font-size: 15px;'>数据为空!</span>
       						 	 </div>
                       	  	  </div>
                       	  	  <div id="selectpage_${opy.id}" style="text-align: center; margin-top: 20px;"></div>
                   			</div>
						<?}else{?>
							<div id="${opy.nameEn}" class="tab-pane fade" style="height:666px;">
							<input type="hidden" id="resid" value="${opy.id}"/>
                        	<div class="row mbl">
                        		<!-- <div class="col-lg-6">
						               <div class="input-group input-group-sm mbs">
						              	<span class="input-group-btn">
						               	<select id="filtrate_${opy.id}" class="btn btn-danger dropdown-toggle" style="width :100px;">
						               	</select>
						                  </span><input id="electText_${opy.id}" type="text" placeholder="请输入关键词..." class="form-control" /><span class="input-group-btn"><button type="button" data-toggle="dropdown" onclick="queryselectText()" class="btn btn-success dropdown-toggle">搜索</button></span>
						              </div> 
					          	 </div>-->
					           <div class="col-lg-12"  style="padding-bottom: 5px; ">
					               <div class="tb-group-actions pull-right">
					               <span>当前共:<label id="pageSize_${opy.id}">0</label>条记录</span>
					               <?for( opc in objectPropertyClasses){
									  if(opc.id == opy.relevanceClassesId){
									?>
					               	&nbsp;&nbsp;&nbsp;&nbsp;<button  class="btn btn-sm btn-primary" type="button" onclick="add('${opc.nameEn}','${opc.id}')"/>新增</button>
					               	<?if(classesEn == 'ke_hu_zi_liao'){?>
					               		<?if(roleName == '超级管理员'){?>
					               			&nbsp;&nbsp;&nbsp;&nbsp;<button  class="btn btn-sm btn-primary" type="button" onclick="deleteAllRelevance()"/>删除全部</button>
					              		<?}?>
					               	<?}else{?>
					               		&nbsp;&nbsp;&nbsp;&nbsp;<button  class="btn btn-sm btn-primary" type="button" onclick="deleteAllRelevance()"/>删除全部</button>
					               	<?}?>
					               	&nbsp;&nbsp;&nbsp;&nbsp;<button id="${opy.id}" name="${opy.id}" class="btn btn-sm btn-primary" type="button" onclick="tadAdd('${opc.nameZh}')"/>选择已有数据</button>
					              <?}}?>
					               </div>
					           </div>
					          	<div id="selectpage_up_${opy.id}" style="text-align: center; margin-top: 20px;"></div>
                         		 <table class="table table-hover table-striped table-bordered table-advanced tablesorter mbn">
           							 <thead>
						                <tr id="pText_${opy.id}"></tr>
						            </thead>
            							<tbody id="text_${opy.id}"></tbody>
       						 	</table>
       						 	 <div id="relevanceData_${opy.id}" style="text-align: center;">
       						 	 	<span class='subtitle' style='font-size: 15px;'>数据为空!</span>
       						 	 </div>
                       	  	  </div>
                       	  	  <div id="selectpage_${opy.id}" style="text-align: center; margin-top: 20px;"></div>
                   			</div>
							<?}?>
                   		<?}?>
					</div>
				</form>
			</div>
		</div>
	</div>

	<!--END CONTENT-->
</div>
	<div id="photos" style="display: none;text-align:center;margin:0 auto;">
	</div>
<!-- 弹框 -->
	<div id="box1" style="display: none; ">
			<span><h2 style="padding-left: 2%;" id="headline"></h2></span>
            <div class="row mbl"style="width: 966PX;" >
            <div style="padding-left: 1%;">
              <div class="col-lg-6">
	              <div class="input-group input-group-sm mbs">
	              <!-- 	<span class="input-group-btn">
	               	<select id="filtrate" class="btn btn-danger dropdown-toggle" style="width :100px;">
	               	</select>
	                  </span> -->
	                <!--  <input id="electText" type="text" placeholder="请输入关键词..." class="form-control" />
	                   <span class="input-group-btn"><button type="button" data-toggle="dropdown" onclick="querypagerelevance()" class="btn btn-success dropdown-toggle">搜索</button></span> -->
	              </div>
          	 </div>
           <div class="col-lg-6">
               <div class="tb-group-actions pull-right" style="padding-top: 2%;"><span>当前共<label id="boxsize"></label>条记录</span></div>
           </div>
           </div>
           		<div style="padding-left: 2%;">
	           		 <table  class="table table-hover table-striped table-bordered table-advanced tablesorter mbn">
					 <thead>
		                <tr id="boxTableOne"></tr>
		            </thead>
	       				<tbody id="boxTableTwo"></tbody>
	  				</table>
	  				</div>
           </div>
            <div id="page1" style="text-align: center; margin-top: 20px;"></div>
        </div>
<?} ?>


<script>
	var relevances;
	var curr;
	var dictId ;
	var multiDictId;
	var multiId;
	var choiceId;
	var choicerRelevanceId;
	var oncliDataId;
	var did = null; 
	var number = null;
	function getdictIdZTree(){
		return dictId
	}
	function getlay() {  
            return did;
    }
	function getnumber() {  
            return number;
    }
	function getchoiceId() {  
            return choiceId;
    }
    
	function getchoicerRelevanceId() {  
            return choicerRelevanceId;
    }
	function getmultiDictId(){
		return multiDictId;
	}
	function getmultiId(){
		return multiId;
	}	
	function getid() {
		return $("#idString").val();
	}
	function getclassid() {
		return $("#classesId").val();
	}
	function getclassname() {
		
		return $("#classesEn").val();
	}
	function getoncliDataId(){
		return oncliDataId;
	}
function saveEditZTree(id,oncliId) {
		dictId=id;
		oncliDataId= oncliId;
		layer.open({
					type : 2,
					area : [ '700px', '530px' ],
					fix : false, //不固定
					maxmin : true,
					scrollbar : false,
					shadeClose : true,
					title : '字典项管理',
					btn : [ '保存 ', '关闭' ],
					skin : 'layui-layer-rim', //加上边框
					content : ["knowledge-edit-data-ztree.html",'no'],
					yes : function(index, layer) {
						//alert(index);
						 var iframeWin = parent.window[layer.find('iframe')[0]['name']];
						//alert(iframeWin);
						iframeWin.queren();
					},
					cancel : function(index) {
					}
				});
			};




	//所属  字典类Id
	//树状结构
	
	function initTree(id) {
	did = id;
	var nameEn = $("#classesEn").val();
		$.ajax({
			type : "post",
			data : {
			"did" : did,
			"nameEn" : nameEn,
			},
			url : "knowledge-edit-data-detail-ajax.html",
			dataType : "json",
			beforeSend : function(XMLHttpRequest) {},
			success : drawTree,
		});
	}
	var setting = {
			check: {
				enable: true,
				chkboxType: {"Y":"", "N":""}
			},
			view: {
				dblClickExpand: false
			},
			data: {
				simpleData: {
					enable: true
				}
			},
			callback: {
				beforeClick: beforeClick,
				onCheck: onCheck
			}
		};
	function drawTree(data) {
		var zNodes = eval(data);
		$.fn.zTree.init($("#"+did), setting, zNodes).expandAll(true);
		showMenu();
		/*  alert(JSON.stringify(zNodes));  */
	}
	
	function beforeClick(treeId, treeNode) {
		var zTree = $.fn.zTree.getZTreeObj(did);
		zTree.checkNode(treeNode, !treeNode.checked, null, true);
		return false;
	}
		
	function onCheck(e, treeId, treeNode) {
			var zTree = $.fn.zTree.getZTreeObj(did),
			nodes = zTree.getCheckedNodes(true),
			v = "";
			for (var i=0, l=nodes.length; i<l; i++) {
				v += nodes[i].name + ",";
			}
			if (v.length > 0 ) v = v.substring(0, v.length-1);
			var cityObj = $("#citySel_"+did);
			cityObj.attr("value", v);
		}

		function showMenu() {
		
			var cityObj = $("#citySel_"+did);
			var cityOffset = $("#citySel_"+did).offset();
			$("#menuContent_"+did).css({left:cityOffset.left + "px", top:cityOffset.top + cityObj.outerHeight() + "px"}).slideDown("fast");

			$("body").bind("mousedown", onBodyDown);
		}
		function hideMenu() {
			$("#menuContent_"+did).fadeOut("fast");
			$("body").unbind("mousedown", onBodyDown);
		}
		function onBodyDown(event) {
			if (!(event.target.id == "menuBtn_"+did || event.target.id == "citySel_"+did || event.target.id == "menuContent_"+did || $(event.target).parents("#menuContent_"+did).length>0)) {
				hideMenu();
			}
		}
	
	//上传图片
	
	function upload(id,count) {
				number=count;
				did = id;
				layer.open({
				    type : 2,
					area : [ '520px', '420px' ],
					fix : false, //不固定
					scrollbar : false,
					shadeClose : true,
					move : false,
					skin : 'layui-layer-rim', //加上边框
					btn : [ '确定' ],
					content :[ "knowledge-edit-data-detail-uploading.html",'no'],
					yes: function(index,layer){
    	                  var iframeWin = parent.window[layer.find('iframe')[0]['name']];
    	                   iframeWin.save();
    	                   show(did,count);
    	              },
					cancel : function(index) {
					}
				});
			}
			
		
	function show(id,count){
		var str = ""; 
		var pho = ""; 
		var onepicture =new Array(); 
		$("#single_"+id).html("");
		$("#photos").html("");
		var aPath = $("#uploadPath").val();
			if(count==1){
				var price = $("#singlePhone_"+id).val();
				str +="<a href='javascript:querypicture()' ><img src=\""+aPath+price+"\" width='30' height='30' /></a>";
				pho +="<img src=\""+aPath+price+"\" tyle='height: auto;max-height: 500px;' />";
				/* var pictureText=price.split('/');
				var onepicture =  pictureText[pictureText.length-1]; */
				$("#single_"+id).html(str);
				$("#photos").html(pho);
				$("#onePhone_"+id).val(price);
		}else{
		var price = $("#parentclassname_"+id).val();
		var arr=new Array();
		arr=price.split(',');//注split可以用字符或字符串分割
		for(var i=0;i<arr.length;i++){
			str +="<img src="+arr[i]+" width='30' height='30' onclick='querypicture()'/>";
				var pictureText=arr[i].split('/');
					 onepicture[i]= pictureText[pictureText.length-1];
		}
		$("#show_"+id).html(str);
		$("#muchPhone_"+id).val(price);
		}
	}	
	
	
	//上传附件
	function adjunct(id,count) {
				number=count;
				did = id;
				layer.open({
				    type : 2,
					area : [ '520px', '420px' ],
					fix : false, //不固定
					scrollbar : false,
					shadeClose : true,
					move : false,
					skin : 'layui-layer-rim', //加上边框
					btn : [ '保存 ', '关闭' ],
					content :[ "knowledge-edit-data-detail-adjunct.html",'no'],
					yes: function(index,layer){
    	                  var iframeWin = parent.window[layer.find('iframe')[0]['name']];
    	                   iframeWin.save();
    	                   accessory(id,count);
    	              },
					cancel : function(index) {
					}
				});
			}
	
	function accessory(id,count){
		var str = ""; 
		var onepicture =new Array();   
		if(count == 1){
				var price = $("#singleAdjunctname_"+id).val();
				str +="<img src="+price+" width='30' height='30'/>";
				var pictureText=price.split('/');
				var onepicture =  pictureText[pictureText.length-1];
				$("#singleName_"+did).html(str);
				$("#oneFile_"+id).val(onepicture);
		}else{
			var price = $("#adjunctname_"+id).val();
			var arr=new Array();
			arr=price.split(',');//注split可以用字符或字符串分割
			for(var i=0;i<arr.length;i++){
				str +="<img src="+arr[i]+" width='30' height='30'/>";
					var pictureText=arr[i].split('/');
					 onepicture[i]= pictureText[pictureText.length-1];
			}
				$("#adjunctname_"+did).html(str);
				$("#muchFile_"+id).val(onepicture);
		}
		
	}
	
	//验证
var wsxForm;
var _editor;
var imagePathId;
var filesPathId;
var filesCount;
$(function(){
	
	wsxForm = $(".wsxForm").Validform({
		tiptype:1,
		tipSweep:true
	});
	_editor = UE.getEditor('uploadImage');
	    _editor.ready(function (){
	        //设置编辑器不可用(事实上不可以设置不可用...所以注释掉,以观后效)
	        _editor.setDisabled();
	        //隐藏编辑器,因为只使用上传功能
	        _editor.hide();
	        //侦听图片上传
	  	 	_editor.addListener('beforeInsertImage',function(t,arg){
	  	 		for(var i=0;i<arg.length;i++){
	  	 				var urlPath = arg[i].src;
	  	 				$("#single_"+imagePathId).html('<a href="javascript:querypho('+imagePathId+')" ><img src='+urlPath+' width="30" height="30"/></a>');
	  	 				 $("#onePhone_"+imagePathId).val(urlPath);
	  	 				 $("#singlePhone_"+imagePathId).val(urlPath);
	  	 		}
	        });
	        //侦听文件上传
		   	 _editor.addListener('afterUpfile',function(t,arg){
		   	 	for(var i=0;i<arg.length;i++){
	  	 			var urlFile = arg[i].url;
	  	 			if(filesCount == '1'){
	  	 				$("#singFile_"+filesPathId).val(urlFile);
		          		$("#singleName_"+filesPathId).html("<a href="+urlFile+" download='w3logo'><img src='static/images/wj.jpg' width='30' height='30' /></a>");
	  	 			}
	  	 			if(filesCount == '2'){
	  	 				 $("#singleAdjunctmuch_"+filesPathId).val(urlFile+"%"+$("#singleAdjunctmuch_"+filesPathId).val());
						 $("#adjunctname_"+filesPathId).append("<a href="+urlFile+" download='w3logo' title='点击下载'><img src='static/images/wj.jpg' width='30' height='30' /></a>");
	  	 			}
	  	 		}
		   	 });
	   });
	    $('#generalTab').find('li').eq(1).find('a').click();
});
	//上传图片
	function upImages(imagesId) {
		imagePathId = imagesId;
		var myFiles = _editor.getDialog("insertimage");
	  		myFiles.open();
	   
	}
	 //上传文件
	function upFiles(filesId,filesMuch) {
		filesPathId = filesId;
		filesCount = filesMuch;
		var myFiles = _editor.getDialog("attachment");
	   	myFiles.open();
	}
function submitForm() {
	// wsxForm.submitForm(false);
	wsxForm.ajaxPost(false);
	return wsxForm.getStatus();
}

	//返回列表
function returnList(){
	var classesEn = $("#classesEn").val();
	var classesId = $("#classesId").val();
	var screenContent =  encodeURI($("#screenContent").val());
	if(screenContent != '' && screenContent != null && screenContent != undefined){
		location.href="show-edit-data-list.html?classesEn="+classesEn+"&classesId="+classesId+screenContent; 
	}else{
		location.href="show-edit-data-list.html?classesEn="+classesEn+"&classesId="+classesId; 
	}
	
}

//图形展示
function graph() {
		layer.open({
			type : 2,
			area : [ '800px', '600px' ],
			fix : false, //不固定
			scrollbar : true,
			shadeClose : true,
			move : false,
			title : "图形展示",
			skin : 'layui-layer-rim', //加上边框
			btn : [ '关闭' ],
			content : [ "knowledge-edit-data-list-graph.html", 'no' ],
			yes: function(index,layer){
    	                  var iframeWin = parent.window[layer.find('iframe')[0]['name']];
    	                   iframeWin.save();
    	              },
					cancel : function(index) {
					}
				});
	};	
	
	
//链表字段
function tadAdd(texts){
	$("#headline").html(texts);
	layer.open({
	    type : 1,
		area : [ '999px', '650px' ],
		fix : false, //不固定
		scrollbar : false,
		shadeClose : true,
		move : false,
		title : '增加',
		skin : 'layui-layer-rim', //加上边框
		btn : [ '保存 ', '关闭' ],
		content :$("#box1"),
		yes: function(){
			queryselectText ();
 	      	layer.closeAll();
			
 	              },
		cancel : function(index) {
		}
	});
}
	//选中内容
	function queryselectText(curr){
	  var value=[];
			$("input[name='checkall']:checked").each(function(){
				value.push($(this).val());
			}); 
			$.ajax({
				type : "post",
				data : {
				"id" : relevances,
				"clickId":oncid,
				"idString":$("#idString").val(),
				"classesId":$("#classesId").val(),
				"classesEn":$("#classesEn").val(),
				"page": curr || 1 ,
				"value" :value
				},
				url : "editrelevance.do",
				dataType : "json",
				traditional : true,
				async: false,
				beforeSend : function(XMLHttpRequest) {},
				success : function(data){
						var ye;
					//alert(JSON.stringify(data));
					 	var tableTwo = "";
		  				for(var i=0;i<data.length;i++){
		  					if(data[i].rmap == ""){
								$("#relevanceData_"+oncid).show();
								document.getElementById('pageSize_'+oncid).innerHTML=0;
							}else{
								$("#relevanceData_"+oncid).hide();
								//弹框内容
					 		 }
					 	 $("#text_"+oncid).html("");
		   					for(var k=0;k<data[i].rmap.length;k++){
		   					tableTwo +="<tr><td style='text-align:center'><input type='checkbox' name='checkallRelevance' value='"+data[i].rmap[k].deleteId+"'></td><td  style='text-align:center'>"+(k+1)+"</td>";
		   					 	for(var j=0;j<data[i].rlist.length;j++){
		   					 		if(data[i].rmap[k][data[i].rlist[j].titleEn] != null && data[i].rmap[k][data[i].rlist[j].titleEn] !='' &&data[i].rmap[k][data[i].rlist[j].titleEn] != undefined){
		   								tableTwo +="<td  style='text-align:center'>"+data[i].rmap[k][data[i].rlist[j].titleEn]+"</td>";
			 						}else{
			 							tableTwo +="<td  style='text-align:center'></td>";
			 						}
			 					}
			 						tableTwo +="<td  style='text-align:center'>"+data[i].rmap[k].createUserId+"</td>"
			 						 		 +"<td  style='text-align:center'>"+data[i].rmap[k].createTime+"</td>"
						 					 +"<td  style='text-align:center'>"
					 						 +"<button type='button' class='btn btn-default btn-xs' onclick='queryDetails("+data[i].rmap[k].id+")'>详情</button>";
					 						if('${classesEn}' == 'ke_hu_zi_liao'){
						               			if('${roleName}' == '超级管理员'){
						               				tableTwo +="<button type='button' class='btn btn-default btn-xs' onclick='deleteselect("+data[i].rmap[k].deleteId+")'>删除</button>";
						               			}
					 						}else{
					 							tableTwo +="<button type='button' class='btn btn-default btn-xs' onclick='deleteselect("+data[i].rmap[k].deleteId+")'>删除</button>";
					 						}
						             tableTwo +="</td></tr>";
			 					document.getElementById('pageSize_'+oncid).innerHTML=data[i].rmap.length;
			 				} 
			 				 ye=data[i].counts;
			 				 
						}
					    	$("#text_"+oncid).append(tableTwo);
			    	 laypage({
						cont : document.getElementById('selectpage_'+oncid), //容器。值支持id名、原生dom对象，jquery对象,
						pages : ye, //总页数
						skip : true, //是否开启跳页
						skin : 'molv', //加载内置皮肤，也可以直接赋值16进制颜色值，如:#c00
						curr : curr || 1,
						last: ye,
						groups : 6,//连续显示分页数
						jump : function(obj, first) { //触发分页后的回调
							if (!first) { //点击跳页触发函数自身，并传递当前页：obj.curr
								queryselectText(obj.curr);
								curr = obj.curr;
							}
						}
					});	
					  laypage({
						cont : document.getElementById('selectpage_up_'+oncid), //容器。值支持id名、原生dom对象，jquery对象,
						pages : ye, //总页数
						skip : true, //是否开启跳页
						skin : 'molv', //加载内置皮肤，也可以直接赋值16进制颜色值，如:#c00
						curr : curr || 1,
						last: ye,
						groups : 6,//连续显示分页数
						jump : function(obj, first) { //触发分页后的回调
							if (!first) { //点击跳页触发函数自身，并传递当前页：obj.curr
								queryselectText(obj.curr);
								curr = obj.curr;
							}
						}
					});	 
				}
			});
			 querypagerelevance();
		}

//查询点击
function queryrelevance(relevanceId, clickId){
	if($("#classesEn").val() == "ke_hu_zi_liao"){
		document.getElementById(clickId).style.display = "none";
	}
	relevances = relevanceId;
	oncid = clickId;
	$.ajax({
			type : "post",
			data : {
			"id" : relevances,
			"clickId":oncid,
			"classesId":$("#classesId").val(),
			"page": curr || 1 ,
			"filtrate":$("#filtrate").val(),
			"electText":$("#electText").val()
			},
			url : "queryrelevance.do",
			dataType : "json",
			beforeSend : function(XMLHttpRequest) {},
			success : function(data){
			//alert(JSON.stringify(data));
			 var str = "";  
			 $("#pText_"+clickId).html(""); 
      		 str +="<th width='50px' style='text-align:center'><input type='checkbox' onclick='selectAllRelevance(this)' class='checkall' name='onecheckallRelevance' /></th><th width='50px'  style='text-align:center'>序号</th>";
      		 for(var i=0;i<data.length;i++){
      		 	for(var j=0;j<data[i].rlist.length;j++){
	      		 	str +="<th style='text-align:center'>"+data[i].rlist[j].titleZh+"</th>";
	      		}
      		 }
      		 str += "<th style='text-align:center'>创建人</th><th style='text-align:center'>创建时间</th><th width='13%' style='text-align:center'>可操作</th>";
      			//alert("+++"+str);
      		 $("#pText_"+clickId).append(str);
      		 
      		/*  //筛选
      		  $("#filtrate").html("");
      		  $("#filtrate_"+clickId).html("");
      		  var screen = "";   
      			screen +=" <option>筛选项</option>";
      			for(var i=0;i<data.length;i++){
      		 		for(var j=0;j<data[i].rlist.length;j++){
	      		 		screen +=" <option value="+data[i].rlist[j].titleEn+">"+data[i].rlist[j].titleZh+"</option>";
	      			}
      			 }
      		 $("#filtrate").append(screen);
      		 $("#filtrate_"+clickId).append(screen); */
     
      		//弹框标题
      		 $("#boxTableOne").html("");
      		  var tableOne = "";   
      		 		tableOne +="<th width='50px' style='text-align:center'><input type='checkbox' onclick='selectAll(this)'  /></th>"
						     +"<th width='50px'  style='text-align:center'>序号</th>";
	      		  for(var i=0;i<data.length;i++){
      		 	   	for(var j=0;j<data[i].rlist.length;j++){
	      		 		tableOne +="<th style='text-align:center'>"+data[i].rlist[j].titleZh+"</th>";
	      		   	}
	      		  }
      			 tableOne += "<th width='13%' style='text-align:center'>可操作</th>";
				 $("#boxTableOne").append(tableOne);
			/*  //弹框内容
			  $("#boxTableTwo").html("");
			 	var tableTwo = "";
  				for(var i=0;i<data.length;i++){
   					for(var k=0;k<data[i].rmap.length;k++){
   					tableTwo +="<tr><td  style='text-align:center'><input name='checkall' type='checkbox' value='"+data[i].rmap[k].id+"'/></td>"
  								  +"<td  style='text-align:center'>"+(k+1)+"</td>";
   					 	for(var j=0;j<data[i].rlist.length;j++){
   							tableTwo +="<td  style='text-align:center'>"+data[i].rmap[k][data[i].rlist[j].titleEn]+"</td>";
	 					}
	 					tableTwo +="<td  style='text-align:center'>"
 						 +"<button type='button' class='btn btn-default btn-xs' onclick='queryDetails("+data[i].rmap[k].id+")'>详情</button>"
 						 +"</td></tr>";
	 					document.getElementById('boxsize').innerHTML=data[i].rmap.length;
	 				} 
				}
			    $("#boxTableTwo").append(tableTwo);
			    laypage({
						cont : document.getElementById('page1'), //容器。值支持id名、原生dom对象，jquery对象,
						pages : 51, //总页数
						skip : true, //是否开启跳页
						skin : 'molv', //加载内置皮肤，也可以直接赋值16进制颜色值，如:#c00
						curr : curr || 1,
						last: 51,
						groups : 6,//连续显示分页数
						jump : function(obj, first) { //触发分页后的回调
							if (!first) { //点击跳页触发函数自身，并传递当前页：obj.curr
								querypagerelevance();
								curr = obj.curr;
							}
						}
					});	 */
					querypagerelevance();
			},
		});
		queryselectText();
	}
	
	//增加刷新
function addQueryrelevance(){
	$.ajax({
			type : "post",
			data : {
			"id" : relevances,
			"clickId":oncid,
			"classesId":$("#classesId").val(),
			"page": curr || 1 ,
			"filtrate":$("#filtrate").val(),
			"electText":$("#electText").val()
			},
			url : "queryrelevance.do",
			dataType : "json",
			beforeSend : function(XMLHttpRequest) {},
			success : function(data){
			//alert(JSON.stringify(data));
			 var str = "";  
			// $("#pText_"+oncid).html(""); 
      		 str +="<th width='50px' style='text-align:center'><input type='checkbox'  onclick='selectAllRelevance(this)' class='checkall' name='onecheckallRelevance' /></th><th width='50px'  style='text-align:center'>序号</th>";
      		 for(var i=0;i<data.length;i++){
      		 	for(var j=0;j<data[i].rlist.length;j++){
	      		 	str +="<th style='text-align:center'>"+data[i].rlist[j].titleZh+"</th>";
	      		}
      		 }
      		 str += "<th style='text-align:center'>创建人</th> <th style='text-align:center'>创建时间</th><th width='13%' style='text-align:center'>可操作</th>";
      			//alert("+++"+str);
      		 $("#pText_"+oncid).html(str);
      		 /* //筛选
      		  $("#filtrate").html("");
      		  $("#filtrate_"+oncid).html("");
      		  var screen = "";   
      			screen +=" <option>筛选项</option>";
      			for(var i=0;i<data.length;i++){
      		 		for(var j=0;j<data[i].rlist.length;j++){
	      		 		screen +=" <option value="+data[i].rlist[j].titleEn+">"+data[i].rlist[j].titleZh+"</option>";
	      			}
      			 }
      		 $("#filtrate").append(screen);
      		 $("#filtrate_"+oncid).append(screen); */
     
      		//弹框标题
      		 $("#boxTableOne").html("");
      		  var tableOne = "";   
      		 		tableOne +="<th width='50px' style='text-align:center'><input type='checkbox' onclick='selectAll(this)'  /></th>"
						     +"<th width='50px'  style='text-align:center'>序号</th>";
	      		  for(var i=0;i<data.length;i++){
      		 	   	for(var j=0;j<data[i].rlist.length;j++){
	      		 		tableOne +="<th style='text-align:center'>"+data[i].rlist[j].titleZh+"</th>";
	      		   	}
	      		  }
      			 tableOne += "<th width='13%' style='text-align:center'>可操作</th>";
				 $("#boxTableOne").append(tableOne);
					querypagerelevance();
			},
		});
	}
	
	//详情
	function queryDetails(detailsId){
		choiceId=detailsId;
		choicerRelevanceId=$("#resid").val();
		layer.open({
			type: 2,
			title: '详情',
			shadeClose: true,
			btn : [ '关闭' ],
			area: ['800px', '600px'],
			content: "querychoicerrelevance?classesId="+relevances+"&id="+detailsId,//iframe的url
			yes : function(index, layer) {
				var iframeWin = parent.window[layer.find('iframe')[0]['name']];
				iframeWin.save();
			},
			cancel : function(index) {
			}
		
			});
		}
	
	//分页查询链表
	function querypagerelevance(curr){
		$.ajax({
			type : "post",
			data : {
			"id" : relevances,
			"clickId":oncid,
			"classesId":$("#classesId").val(),
			"page": curr || 1 ,
			/*  "filtrate":$("#filtrate").val(),
			"electText":$("#electText").val(),  */
			},
			url : "queryrelevance.do",
			dataType : "json",
			beforeSend : function(XMLHttpRequest) {},
			success : function(data){
			//alert(JSON.stringify(data));
			 //弹框内容
			  $("#boxTableTwo").html("");
			 	var tableTwo = "";
			 	var ye;
  				for(var i=0;i<data.length;i++){
   					for(var k=0;k<data[i].rmap.length;k++){
   					tableTwo +="<tr><td  style='text-align:center'><input name='checkall'  type='checkbox' id='"+data[i].rmap[k].id+"' value='"+data[i].rmap[k].id+"'/></td>"
  								  +"<td  style='text-align:center'>"+(k+1)+"</td>";
   					 	for(var j=0;j<data[i].rlist.length;j++){
   					 		if(data[i].rmap[k][data[i].rlist[j].titleEn] != null && data[i].rmap[k][data[i].rlist[j].titleEn]!='' && data[i].rmap[k][data[i].rlist[j].titleEn]!=undefined){
   					 			tableTwo +="<td  style='text-align:center'><label for='"+data[i].rmap[k].id+"' name='checkall'>"+data[i].rmap[k][data[i].rlist[j].titleEn]+"</label></td>";
   					 		}else{
   					 			tableTwo +="<td  style='text-align:center'><label for='"+data[i].rmap[k].id+"' name='checkall'></label></td>";
   					 		}
	 					}
	 					tableTwo +="<td  style='text-align:center'>"
 						 +"<button type='button' class='btn btn-default btn-xs' onclick='queryDetails("+data[i].rmap[k].id+")'>详情</button>"
 						 +"</td></tr>";
	 					document.getElementById('boxsize').innerHTML=data[i].rmap.length;
	 				} 
	 				 ye=data[i].counts;
				}
			    $("#boxTableTwo").append(tableTwo);
			    laypage({
						cont : document.getElementById('page1'), //容器。值支持id名、原生dom对象，jquery对象,
						pages : ye, //总页数
						skip : true, //是否开启跳页
						skin : 'molv', //加载内置皮肤，也可以直接赋值16进制颜色值，如:#c00
						curr : curr || 1,
						last: ye,
						groups : 6,//连续显示分页数
						jump : function(obj, first) { //触发分页后的回调
							if (!first) { //点击跳页触发函数自身，并传递当前页：obj.curr
								querypagerelevance(obj.curr);
								curr = obj.curr;
							}
						}
					});	
			},
		});
	}	
		//----------------------------全选-------------------------------
	function selectAll(obj){
		if($(obj).is(":checked")){
			$("input[name=checkall]").each(function(){
				   $(this).prop("checked", "true");
				});
		}else{
			$("input[name=checkall]").each(function(){
				   $(this).removeAttr("checked");
				});
		}
	}
	function selectAllRelevance(obj){
		if($(obj).is(":checked")){
			$("input[name=checkallRelevance]").each(function(){
				   $(this).prop("checked", "true");
				});
		}else{
			$("input[name=checkallRelevance]").each(function(){
				   $(this).removeAttr("checked");
				});
		}
	}
	//删除
	function deleteselect(deleteid){
		if (confirm("是否确认删除！！")) {
			$.ajax({
				type : "post",
				data : {
				"id" : relevances,
				"clickId":oncid,
				"idString":$("#idString").val(),
				"classesId":$("#classesId").val(),
				"classesEn":$("#classesEn").val(),
				"deleteid" : deleteid
				},
				url : "deleterelevance.do",
				dataType : "json",
				traditional : true,
				beforeSend : function(XMLHttpRequest) {},
				success : function(data){
				queryselectText();
				}
				
			});
		}
	}
	//删除全部关联
	function deleteAllRelevance(){
		if (confirm("是否确认删除全部！！")) {
			  var value=[];
				$("input[name='checkallRelevance']:checked").each(function(){
					value.push($(this).val());
				}); 
			$.ajax({
				type : "post",
				data : {
				"id" : relevances,
				"clickId":oncid,
				"idString":$("#idString").val(),
				"classesId":$("#classesId").val(),
				"classesEn":$("#classesEn").val(),
				"deleteids" : value
				},
				url : "deleterelevanceAll.do",
				dataType : "json",
				traditional : true,
				async: false,
				beforeSend : function(XMLHttpRequest) {},
				success : function(data){
				queryselectText();
				}
				
			});
		}
	}
	
	
	//添加
	function add(relname,relid) {  
		layer.open({
			type: 2,
			title: '新增关联数据',
			shadeClose: true,
			btn : [ '保存','关闭' ],
			area: ['800px', '600px'],
			content: ["show-edit-data-detail.html?classesId="+relid+"&classesEn="+relname+"&clichId="+oncid+"&idString="+$("#idString").val()+"&subjectClassesEn="+$("#classesEn").val()+"&rel=1",'yes'],//iframe的url
			yes : function(index, layer) {
			var iframeWin = parent.window[layer.find('iframe')[0]['name']];
				iframeWin.submitForm();
			},
			cancel : function(index) {
			}
		});
	}
	//增加放大图片
	function querypicture(){
		var index=layer.open({
		  type: 1,
		  title: false,
		  closeBtn: 1,
		  area: ['auto','auto'],
		  skin: 'layui-layer-nobg', //没有背景色
		  shadeClose: true,
		  content: $('#photos')
		});
		layer.iframeAuto(index);
	}
	//编辑放大
	function querypho(phoPhathId){
		var singph = $("#singlePhone_"+phoPhathId).val();
		if(singph != null && singph != '' && singph != undefined){
			$('#phs').html("<img src=\""+singph+"\" style='height: auto;max-height: 500px;' />");
		}
		var index=layer.open({
		  type: 1,
		  title: false,
		  closeBtn: 1,
		  area: ['auto','auto'],
		  skin: 'layui-layer-nobg', //没有背景色
		  shadeClose: true,
		  content: $('#phs')
		});
		layer.iframeAuto(index);
	}
	//关联弹框放大
	function queryphogl(relpicture){
		$("#photos").html("");
	 	var pho="";
	 	pho+="<img src=\""+relpicture+"\" style='height: auto;max-height: 500px;'/>"
	 	$("#photos").html(pho);
	
		var index=layer.open({
		  type: 1,
		  title: false,
		  closeBtn: 1,
		  area: ['auto','auto'],
		  skin: 'layui-layer-nobg', //没有背景色
		  shadeClose: true,
		  content: $('#photos')
		});
		layer.iframeAuto(index);
	}
	//关联放大
	function queryrelevancepicture(relevancepicture){
		$("#photos").html("");
	 	var pho="";
	 	pho+="<img src=\""+relevancepicture+"\" style='height: auto;max-height: 500px;'/>"
	 	$("#photos").html(pho);
	
		var index=layer.open({
		  type: 1,
		  title: false,
		  closeBtn: 1,
		  area: ['auto','auto'],
		  skin: 'layui-layer-nobg', //没有背景色
		  shadeClose: true,
		  content: $('#photos')
		});
		layer.iframeAuto(index);
	}
	
	//为客户资料时验证
	function verify(verifyValue,key){
	var testEle = document.getElementById(key);
	var demo = testEle.attributes["demo"].nodeValue; 
		var headline = $("#headline").val();
		if(headline == '客户资料' && verifyValue != demo && verifyValue != ''){
			if(key == 'xingMing' || key == 'shouJi' || key == 'xing_ming' || key == 'shou_ji'){
				if(key == 'shouJi' || key == 'shou_ji'){
					var reg = new RegExp("^\\d{11}$");
					 if(!reg.test(verifyValue)){
					        layer.msg('请输入正确的11位手机号！');
							$("#"+key).val("");
					 }else{
						 $.ajax({
							type : "post",
							data : {
								"key" : key,
								"value" : verifyValue,
								"classesEn" : $("#classesEn").val(),
							},
							url : "verifyValue.do",
							dataType : "json",
							traditional : true,
							beforeSend : function(XMLHttpRequest) {},
							success : function(data){
								if(data != '0'){
									layer.msg('已存在，请重新输出！');
									$("#"+key).val(demo);
								}
							},
						});
					 }
				}else{
					$.ajax({
						type : "post",
						data : {
							"key" : key,
							"value" : verifyValue,
							"classesEn" : $("#classesEn").val(),
						},
						url : "verifyValue.do",
						dataType : "json",
						traditional : true,
						beforeSend : function(XMLHttpRequest) {},
						success : function(data){
							if(data != '0'){
								layer.msg('已存在，请重新输出！');
								$("#"+key).val(demo);
							}
						},
					});
				}
			}
		}
	}
	//多选
	function multiEditZTree(multiDict,multi){
		multiDictId=multiDict;
		multiId=multi;
		layer.open({
			type : 2,
			area : [ '700px', '530px' ],
			fix : false, //不固定
			maxmin : true,
			scrollbar : false,
			shadeClose : true,
			title : '字典项管理',
			btn : [ '保存 ', '关闭' ],
			skin : 'layui-layer-rim', //加上边框
			content : ["knowledge-edit-multi-ztree.html",'no'],
			yes : function(index, layer) {
				 var iframeWin = parent.window[layer.find('iframe')[0]['name']];
				iframeWin.queren();
			},
			cancel : function(index) {
			}
		});
	}
	//单个发布
	function publish(){
	if (confirm("是否确认发布！！")){
		layer.msg('数据正在发布中，请稍候几分钟后在检索平台刷新页面获取最新数据。');
		$.ajax({
				type : "post",
				url : "knowledgeEditDataPublish.do",
				dataType : "json",
				data:{
      				"classesEn":$("#classesEn").val(),
      				"id":$("#idString").val()
				},
   				beforeSend : function(XMLHttpRequest) {},
				success:function(res){
					if(res == 'yes'){
							 layer.msg('发布成功！');
						}else{
							layer.msg('发布失败！');
						}
				},
				error:function(){
				//	alert("发布失败");
				}
	
			});
		}
	}
	var aliyunValue;
	function getaliyunId(){
		return aliyunValue;
	}
	var aliyunUploadingData='';
	function getAliyunUploadingData(){
		return aliyunUploadingData;
	}
	//阿里云上传
	function aliyunUploading(aliyunId){
		aliyunValue=aliyunId;
		aliyunUploadingData = $("#dictitemId_"+aliyunId).val();
		layer.open({
			type : 2,
			area : [ '800px', '530px' ],
			fix : false, //不固定
			maxmin : true,
			scrollbar : false,
			shadeClose : true,
			title : '阿里云上传',
			btn : [ '保存 ', '关闭' ],
			skin : 'layui-layer-rim', //加上边框
			content : ["knowledge-edit-aliyun-uploading.html",'no'],
			yes : function(index, layer) {
				 var iframeWin = parent.window[layer.find('iframe')[0]['name']];
				iframeWin.queren();
			},
			cancel : function(index) {
			}
		});
	}
	//删除图片
	function deleteImages(delimpId){
		$("#single_"+delimpId).html("");
		$("#singlePhone_"+delimpId).val("");
		$("#onePhone_"+delimpId).val("");
	}
	//删除文件
	function deletefileone(delimpId){
		$("#singleName_"+delimpId).html("");
		$("#singFile_"+delimpId).val("");
	}
	//删除文件
	function deletefilemuch(delimpId){
		$("#adjunctname_"+delimpId).html("");
		$("#singleAdjunctmuch_"+delimpId).val("");
	}
	//审核
	function auditWord(auditStatus){
		var value=[];
			value.push($("#idString").val());
		if(value != ''){
			$.ajax({
					type : "post",
					url : "auditStatus.do",
					dataType : "json",
					data:{
	   					"id":value,
	   					"status":auditStatus,
	   					"classesEn":$("#classesEn").val()
					},
					traditional : true,
					beforeSend : function(XMLHttpRequest) {},
					success:function(data){
						if(data == 'yes'){
							if(auditStatus == '1'){
								layer.msg('操作成功，已通过！');
							}else{
								layer.msg('操作成功，未通过！');
							}
						}else{
							layer.msg('操作失败！');
						}
					},
					error:function(){
						alert("编辑失败");
					}
		
			})
			}else{
				layer.msg('请勾选内容！');
			}
	}
</script>


